import numpy as np
import time

in_data_list = ['train_set/grid_array_1000_20241114.npy',
                'train_set/grid_array_5000_20241118.npy',
                'train_set/grid_array_5000_20241122.npy',
                'train_set/grid_array_2276_20241218.npy',
                'train_set/grid_array_5000_20241228.npy',
                'train_set/grid_array_4707_20250101.npy',
                'train_set/grid_array_5000_20250105.npy']

out_data_list = ['train_set/s_para_array_1000_20241114.npy',
                 'train_set/s_para_array_5000_20241118.npy',
                 'train_set/s_para_array_5000_20241122.npy',
                 'train_set/s_para_array_2276_20241218.npy',
                 'train_set/s_para_array_5000_20241228.npy',
                 'train_set/s_para_array_4707_20250101.npy',
                 'train_set/s_para_array_5000_20250105.npy']
in_data = np.empty((0, 25))
out_data = np.empty((0, 151))

for i in range(len(in_data_list)):
    in_data_array = np.load(in_data_list[i])
    out_data_array = np.load(out_data_list[i])

    if i == 0:
        in_data = in_data_array
        out_data = out_data_array
    else:
        in_data = np.concatenate((in_data, in_data_array), axis=0)
        out_data = np.concatenate((out_data, out_data_array), axis=0)

total_data_num_in = len(in_data)
total_data_num_out = len(out_data)
if total_data_num_in != total_data_num_out:
    raise ValueError('in_data and out_data have different length')

time_stamp = time.strftime('%Y-%m-%d_%H-%M', time.localtime())
np.save(f'train_set/grid_array_{total_data_num_in}_{time_stamp}.npy', in_data)
np.save(f'train_set/s_para_array_{total_data_num_out}_{time_stamp}.npy', out_data)
